import JSEncrypt from 'jsencrypt';

export function getRsaCode(str) {
    let pubKey = 'MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCPbo5XHAuAyXWRnlHo+g3oEzvdljLn91OmdZ9fKfJtMrbvR61N+vOuUtLVmEWD3DbKc3BG8aN0uxFZJfU4z7E/m0zYZ9nOdkfGWJSgMzlp4oeypUsUJpLkDoTWXZ8ddyFuovLlA3qZvgAvir0PDFeamQFoeKH4QXVUP7SOPkDSNwIDAQAB';
    let encryptStr = new JSEncrypt();
    encryptStr.setPublicKey(pubKey); // 设置 加密公钥
    let data = encryptStr.encrypt(str.toString()); // 进行加密
    return data;

}